import { mergeConfig } from 'vite';
import basicSsl from '@vitejs/plugin-basic-ssl';
import baseConfig from './vite.config.base';

export default mergeConfig(
  {
    mode: 'development',
    server: {
      open: true,
      port: '3000',
      host: '0.0.0.0',
      https: false,
      fs: {
        strict: true,
      },
      proxy: {
        '/api': {
            target: 'http://blog.shilinwei.com:81',
            // target: 'http://localhost:1007',
          changeOrigin: true,
          secure: false,
          logLevel: 'debug',
          // rewrite: (path:any) => path.replace(/^\/api/, ''),
        },
      },
    },

    plugins: [
      basicSsl()
      // eslint({
      //   cache: false,
      //   include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
      //   exclude: ['node_modules'],
      // }),
    ],
  },
  baseConfig
);
